package com.inspur.cloud.enums;

public enum ResourceTypeEnum {
    HDFS(1,"HDFS"),
    HBASE(2,"HBASE"),
    HIVE(3,"HIVE"),
    YARN(4,"YARN"),
    KAFKA(5,"KAFKA");

    private Integer type;
    private String resourceType;

    ResourceTypeEnum(Integer type, String resourceType) {
        this.type = type;
        this.resourceType = resourceType;
    }

    public static  String getDescByType(Integer type) {
        if(type==null) return "";
        for (ResourceTypeEnum e : ResourceTypeEnum.values()) {
                if(e.getType().equals(type)){
                    return e.getResourceType();
                }
        }
        return "";
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getResourceType() {
        return resourceType;
    }

    public void setResourceType(String resourceType) {
        this.resourceType = resourceType;
    }
}
